#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e5 + 5;
const int INF = 1e9;

int n, m, q;
int a[N], b[N];
int lg[N];
struct Node {
  int mx, mn, z, f;
} ta[N][18], tb[N][18];
Node merge(Node x, Node y) {
  Node z;
  z.mx = max(x.mx, y.mx);
  z.mn = min(x.mn, y.mn);
  z.z = min(x.z, y.z);
  z.f = max(x.f, y.f);
  return z;
}
void init() {
  rep(i, 2, max(n, m)) lg[i] = lg[i >> 1] + 1;
  rep(i, 1, n) {
    ta[i][0] = Node{a[i], a[i], INF, -INF};
    if (a[i] > 0) ta[i][0].z = a[i];
    if (a[i] < 0) ta[i][0].f = a[i];
    if (a[i] == 0) ta[i][0].z = ta[i][0].f = 0;
  }
  rep(i, 1, m) {
    tb[i][0] = Node{b[i], b[i], INF, -INF};
    if (b[i] > 0) tb[i][0].z = b[i];
    if (b[i] < 0) tb[i][0].f = b[i];
    if (b[i] == 0) tb[i][0].z = tb[i][0].f = 0;
  }
  rep(j, 1, 16) {
    int len = 1 << j;
    rep(i, 1, n + 1 - len) ta[i][j] =
        merge(ta[i][j - 1], ta[i + len / 2][j - 1]);
    rep(i, 1, m + 1 - len) tb[i][j] =
        merge(tb[i][j - 1], tb[i + len / 2][j - 1]);
  }
}
Node query(Node t[N][18], int l, int r) {
  int k = lg[r + 1 - l];
  int len = 1 << k;
  return merge(t[l][k], t[r + 1 - len][k]);
}
ll solve(int l1, int r1, int l2, int r2) {
  Node x = query(ta, l1, r1), y = query(tb, l2, r2);
  if (y.mn <= 0 && y.mx >= 0) {
    if (x.mn <= 0 && x.mx >= 0)
      return max(1ll * y.mn * x.z, 1ll * y.mx * x.f);
    else if (x.mn > 0)
      return 1ll * x.mn * y.mn;
    else
      return 1ll * x.mx * y.mx;
  } else if (y.mn > 0) {
    if (x.mx <= 0)
      return 1ll * x.mx * y.mx;
    else
      return 1ll * x.mx * y.mn;
  } else /*if (y.mx < 0)*/ {
    if (x.mn >= 0)
      return 1ll * x.mn * y.mn;
    else
      return 1ll * x.mn * y.mx;
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> q;
  rep(i, 1, n) cin >> a[i];
  rep(i, 1, m) cin >> b[i];
  init();
  while (q--) {
    int l1, r1, l2, r2;
    cin >> l1 >> r1 >> l2 >> r2;
    ll res = solve(l1, r1, l2, r2);
    cout << res << endl;
  }
  return 0;
}